package com.forum.pojo;
// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;


/**
 * Reply entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="t_reply"
    ,catalog="forum"
)

public class Reply  implements java.io.Serializable {


    // Fields    

     private Integer replypostid;
     private User user;
     private Post post;
     private String replycontent;
     private String replytime;


    // Constructors

    /** default constructor */
    public Reply() {
    }

	/** minimal constructor */
    public Reply(Post post) {
        this.post = post;
    }
    
    /** full constructor */
    public Reply(User user, Post post, String replycontent, String replytime) {
        this.user = user;
        this.post = post;
        this.replycontent = replycontent;
        this.replytime = replytime;
    }

   
    // Property accessors
    @GenericGenerator(name="generator", strategy="increment")@Id @GeneratedValue(generator="generator")
    
    @Column(name="replypostid", unique=true, nullable=false)

    public Integer getReplypostid() {
        return this.replypostid;
    }
    
    public void setReplypostid(Integer replypostid) {
        this.replypostid = replypostid;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="replier")

    public User getUser() {
        return this.user;
    }
    
    public void setUser(User user) {
        this.user = user;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="replyto", nullable=false)

    public Post getPost() {
        return this.post;
    }
    
    public void setPost(Post post) {
        this.post = post;
    }
    
    @Column(name="replycontent")

    public String getReplycontent() {
        return this.replycontent;
    }
    
    public void setReplycontent(String replycontent) {
        this.replycontent = replycontent;
    }
    
    @Column(name="replytime", length=31)

    public String getReplytime() {
        return this.replytime;
    }
    
    public void setReplytime(String replytime) {
        this.replytime = replytime;
    }
   








}